package AddonsSheepContoller.ASPlayer.Manager;

import AddonsSheepContoller.ASPlayer.ASAccount;

public class ASAccountManagerCenter {
    private ASAccount[] storageCenter;

    public ASAccount foundPlayer(String uid) {
        for(ASAccount finder : storageCenter) {
            if(finder.getPlayerUid().equalsIgnoreCase(uid))
                return finder;
        }

        return null;
    }

    public int foundAccountId(String uid) {
        for(int i = 0; i < this.storageCenter.length; i++) {
            if(this.storageCenter[i].getPlayerUid().equalsIgnoreCase(uid))
                return i;
        }

        return -1;
    }

    public void removeAccount(int index) { this.storageCenter[index] = null; }
    public void addAccount(ASAccount account) { this.storageCenter[this.storageCenter.length] = account; }
}
